import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '姓名',
    align:"center",
    dataIndex: 'name'
  },
  {
    title: '电话',
    align:"center",
    dataIndex: 'phone'
  },
  {
    title: '证件类型',
    align:"center",
    dataIndex: 'paperType_dictText'
  },
  {
    title: '证件号码',
    align:"center",
    dataIndex: 'paperNumber'
  },
  {
    title: '通行类型',
    align:"center",
    dataIndex: 'type_dictText'
  },
   {
    title: '通行时间',
    align:"center",
    dataIndex: 'recordTime',
   },
   {
    title: '校验方式',
    align:"center",
    dataIndex: 'validateType_dictText'
   },
   {
    title: '设备地点',
    align:"center",
    dataIndex: 'address'
   },
   {
    title: '现场照片',
    align:"center",
    dataIndex: 'photo'
   },

];
//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "姓名",
    field: 'name',
    component: 'JInput',
    //colProps: {span: 6},
  },
  {
    label: "电话",
    field: 'phone',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: '证件类型',
    field: 'paperType',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode:"paperType",
    }
  },
  {
    label: '证件号码',
    field: 'paperNumber',
    component: 'Input',
  },
  {
    label: '通行时间',
    field: 'recordTime',
    component: 'RangePicker',
    componentProps: {
      valueType: 'Date',
      //showTime:true
    },
  },
  {
    label: '校验方式',
    field: 'validateType',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode:"visit_record_validateType"
    }
  },


];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '通行时间',
    field: 'recordTime',
    component: 'DatePicker',
  },
  {
    label: '校验方式',
    field: 'validateType',
    component: 'InputNumber',
  },
  {
    label: '通行方式',
    field: 'passType',
    component: 'InputNumber',
  },
  {
    label: '设备地点',
    field: 'address',
    component: 'Input',
  },
  {
    label: '现场照片',
    field: 'photo',
    component: 'Input',
  },
  {
    label: '人员id',
    field: 'personid',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  recordTime: {title: '通行时间',order: 0,view: 'date', type: 'string',},
  validateType: {title: '校验方式',order: 1,view: 'number', type: 'number',},
  passType: {title: '通行方式',order: 2,view: 'number', type: 'number',},
  address: {title: '设备地点',order: 3,view: 'text', type: 'string',},
  photo: {title: '现场照片',order: 4,view: 'text', type: 'string',},
  personid: {title: '人员id',order: 5,view: 'text', type: 'string',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}
